package com.lianheng.cms.common.gen;

import com.jfinal.plugin.activerecord.generator.MetaBuilder;
import com.lianheng.cms.common.GenAppTest;

import javax.sql.DataSource;
import java.util.Set;

public class IMetaBuilder extends MetaBuilder {

    public IMetaBuilder(DataSource dataSource) {
        super(dataSource);
    }

    /**
     * 此处填入需要生成model的表
     **/
    @Override
    protected boolean isSkipTable(String tableName) {
//        String[] tableArray = {
//                "t_department",
//        };
//        for (int i = 0; i < tables.size(); i++) {
//            if (tableName.equals(tableArray.[i])){
//                return false;
//            }
//        }
        Set<String> tables = GenAppTest.tablearray.keySet();
        for (String table : tables) {
            if (tableName.equals(table)) {
                return false;
            }
        }
        return true;
    }

}
